package com.imust.springbootproject.service;

import com.imust.springbootproject.dao.TravelerRepository;
import com.imust.springbootproject.po.Traveler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TravelerServiceImpl implements TravelerService{
    @Autowired
    private TravelerRepository travelerRepository;


    @Override
    public Traveler login(String travelername, String travelerpassword) {
        Traveler traveler = travelerRepository.findByTravelernameAndTravelerpassword(travelername, travelerpassword);
        return traveler;
    }

    @Override
    public Traveler save(Traveler traveler) {
        return travelerRepository.save(traveler);
    }

    @Override
    public Traveler findByTravelername(String travelername) {
        return travelerRepository.findByTravelername(travelername);
    }
}
